<template>
  <div class="item">
    <img
      :class="img_size ? 'begin_row' : 'begin_row_end'"
      :src="require(`@/assets/steps_image/${bgimage}${active ? '_active' : ''}.png`)"
      alt=""
    />
    <div class="iconcontent">
      <div class="title">{{ title }}</div>
      <div :class="`border-line  ${disabled?'disbaled':'no-disabled'}`">
        <div class="icon">
          <img
            :data-index="index"
            :data-disabled="disabled"
            :src="require(`@/assets/steps_image/${icon_img}${active ? '__active' : ''}.png`)"
            alt=""
          />
        </div>
        <div class="sub-title" :data-index="index" :data-disabled="disabled">{{ sub_title }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { number } from 'echarts'
export default {
  name: 'jsStpsItem',
  props: {
    bgimage: {
      type: String,
      default: '',
    },
    title: {
      type: String,
      default: '准备阶段',
    },
    sub_title: {
      type: String,
      default: '未执行',
    },
    icon_img: {
      type: String,
      default: '',
    },
    img_size: {
      type: Boolean,
      default: true,
    },
    index: {
      type: Number,
      default: 0,
    },
    active: {
      type: Boolean,
      default: false,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
}
</script>

<style lang="less" scoped>
.item {
  flex: 1;
  position: relative;
}

.item .iconcontent {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
  font-weight: 600;
}

.item:nth-child(1) .iconcontent {
  color: rgb(243, 158, 151);
  border-color: rgb(243, 158, 151);
}

.item:nth-child(2) .iconcontent {
  color: rgb(57, 86, 166);
  border-color: rgb(57, 86, 166);
}

.item:nth-child(3) .iconcontent {
  color: rgb(252, 167, 74);
  border-color: rgb(252, 167, 74);
}

.item:nth-child(4) .iconcontent {
  color: rgb(203, 125, 183);
  border-color: rgb(203, 125, 183);
}

.item:nth-child(5) .iconcontent {
  color: rgb(57, 86, 166);
  border-color: rgb(57, 86, 166);
}

.item .iconcontent .icon {
  width: 122px;
  height: 55px;
  border-radius: 12px;
}

.item .iconcontent .icon img {
  width: 100%;
  height: 100%;
}

.item .iconcontent .border-line {
  border: 2px solid;
  border-radius: 7px;
  box-sizing: border-box;
}
.disbaled {
  cursor: not-allowed;
}
.no-disabled {
  cursor: pointer;
}
.begin_row,
.begin_row_end {
  width: 103%;
  height: 15px;
  position: absolute;
  top: 50%;
  z-index: 99;
}

.begin_row_end {
  width: 100%;
}

.sub-title,
.title {
  text-align: center;
  height: 30px;
  line-height: 30px;
  box-sizing: border-box;
}
.title {
  font-size: 16px;
}
.sub-title {
  border-top: 1px solid;
  background-color: #fff;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
</style>

